<template>
    <!--承运人-->
    <div id="CarrierDetails">
        <v-details :detailData="inputData" :inputConfig="inputConfig" @pop="setdata"></v-details>
    </div>
</template>

<script>
    import details from "commons/Detail";
    import baseMixin from "@/mixins/BaseMixin";

    export default {
        name: "CarrierDetails",
        mixins: [baseMixin],
        props: {
            inputData: {
                type: Object
            }
        },

        data() {
            return {
                inputConfig: [
                    [
                        {
                            type: "table",
                            label: this.$t('bill.carrierCode'),
                            props: "carrierkey",
                            tableConfig: [
                                {
                                    label: this.$t('config.carrier'),
                                    prop: "storerkey",
                                    input: "input"
                                },
                                {label: this.$t('config.company'), prop: "company", input: "input"},
                                {
                                    label: this.$t('config.city'),
                                    prop: "city",
                                    input: "input"
                                },
                                {label: this.$t('config.provice'), prop: "state", input: "input"},
                                {
                                    label: this.$t('config.postcode'),
                                    prop: "zip",
                                    input: "input"
                                }
                            ],
                            url: "queryStorer/3/?/wmwhse1"
                        },
                        {
                            type: "input",
                            label: this.$t('in.carriername'),
                            props: "carriername"
                        },
                        {
                            type: "input",
                            label: this.$t('config.address',{no:'1'}),
                            props: "carrieraddress1"
                        },
                        {
                            type: "input",
                            label: this.$t('config.address',{no:'2'}),
                            props: "carrieraddress2"
                        },
                        {
                            type: "input",
                            label: this.$t('config.city'),
                            props: "carriercity"
                        },
                        {
                            type: "input",
                            label: this.$t('bill.province'),
                            props: "carrierstate"
                        },
                        {
                            type: "input",
                            label: this.$t('config.postcode'),
                            props: "carrierzip"
                        },
                    ],
                    [
                        {
                            type: "input",
                            label: this.$t('in.carriername'),
                            props: "carrierreference"
                        },
                        {
                            type: "input",
                            label: this.$t('in.appointmentkey'),
                            disabled: true,
                            props: "appointmentkey"
                        },
                        {
                            type: "input",
                            label: this.$t('in.door'),
                            props: "door"
                        },
                        {
                            type: "date",
                            label: this.$t('in.arrivaldatetime'),
                            props: "arrivaldatetime"
                        },
                        {
                            type: "date",
                            label: this.$t('in.actualdeparturedate'),
                            props: "actualdeparturedate"
                        },
                        {
                            type: "input",
                            label: this.$t('config.phone'),
                            props: "carrierphone"
                        },
                        {
                            type: "input",
                            label: this.$t('bill.country'),
                            props: "carriercountry"
                        },
                    ],
                    [
                        {
                            type: "input",
                            label: this.$t('in.trailernumber'),
                            props: "trailernumber"
                        },
                        {
                            type: "input",
                            label: this.$t('in.trailerdesc'),
                            disabled: true,
                            props: ""
                        },
                        {
                            type: "input",
                            label: this.$t('in.trailerowner'),
                            props: "trailerowner"
                        },
                        {
                            type: "input",
                            label: this.$t('in.drivername'),
                            props: "drivername"
                        },
                        {
                            type: "input",
                            label: this.$t('in.temperature'),
                            props: "temperature"
                        }
                    ]
                ]
            };
        },
        methods: {
            setdata(data, id, close) {
                this.inputData.carrierkey = data.storerkey;
                this.inputData.carriername = data.company;
                close(false);
            }
        },
        mounted() {
        },
        components: {
            "v-details": details
        }
    };
</script>

<style scoped>
</style>

